<template>
  <!-- 删除客户组件 -->
  <div>
      <el-button type="primary" size="mini" @click="delBtn">删除</el-button>
  
  </div>
</template>

<script>
import local from "@/utils/local.js";
import Api from "@/http/apis/modules/custManagement.js";
import { Message } from "element-ui";
export default {
    props:{
        binding:{
            type:String,
            default:'',
        },
        delArr:{
            type:Array,
            default:[],
        },
    },
  data() {
    return {
      dialogFormVisible: false,
      form: {
        region: "",
      },
      formLabelWidth: "120px",
    };
  },
   methods: {
    //    点击删除
    delBtn(){
        if(this.delArr.length==0){
            this.$message({
              type: 'error',
              message: "请选择数据！",
            });
        }else{
            this.open()
        }
    },
    
      open() {
        console.log("删除组件数据",this.delArr);
        this.$alert('是否删除客户？', '', {
          confirmButtonText: '确定',
          callback:async action => {
              if(action=='confirm'){
                  let re=await Api.delCustApi(this.delArr)
                  console.log(re);
              }          
          }
        });
      },
    },
    created(){
    }
};
</script>

<style lang="less" scoped>
</style>